<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>axios并发发送请求</title>
</head>
<body>

</body>
</html>
<!--引入axios异步请求核心js文件-->
<script src="../axios.min.js"></script>
<!--测试异步请求-->
<script>

    function demo() {
        return axios.get('http://localhost:8989/user/?id=11');
    }

    function demo2() {
        return axios.get('http://localhost:8989/demo');
    }

    //并发请求
    axios.all([demo(), demo2()]).then(axios.spread((res1, res2) => {
        console.log(res1);
        console.log(res2);
    }));
</script>